package Cantella::DJabberd::Web::Controller::Admin::JabberGroup;

#the order the following IS RELEVANT
use base 'Cantella::DJabberd::Web::UI::Controller::Collection::CRUD';
use Reaction::Class;

__PACKAGE__->config
  (
   model_name => 'Admin',
   collection_name => 'jabber_groups',
   action =>
   { base => { Chained => '/admin/base', PathPart => 'jabber_group' },
     create => { ViewPort => {field_order => [qw(name description user_jids)],},},
     update => { ViewPort => {field_order => [qw/name description user_jids/],},},
     list   => { ViewPort => {
                              exluded_fields => [qw/id/],
                              field_order => [qw/name description/],
                             },
               },
     view   =>
     { ViewPort =>
       {
        field_order    => [qw/name description user_jids/],
        exluded_fields => [qw/id/],
        Field => { user_jids => { controller => 'Admin::UserJid' },},
       },
     },
   },
  );

sub base :Action :CaptureArgs(0) {
  my ($self, $c) = @_;
  $c->stash->{submenu}->current_item('groups');
}

1;
